package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/13 16:47
 * 邮箱：648859026@qq.com
 */
public class RegisterStep2Action extends AHttpService<PbBean.PbResUserRegisterStep2> {
    /**
     * 注册步骤2/验证手机
     *
     * @param context
     * @param verificationCode 验证码
     * @return
     */
    public static RegisterStep2Action newInstance(Context context, String verificationCode, String mobile) {
        return new RegisterStep2Action(context, verificationCode, mobile);
    }

    private String verificationCode;
    private String mobile;

    private RegisterStep2Action(Context context, String verificationCode, String mobile) {
        super(context);
        this.verificationCode = verificationCode;
        this.mobile = mobile;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqUserRegisterStep2.Builder builder = PbBean.PbReqUserRegisterStep2.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setVerificationCode(verificationCode);
        builder.setMobile(mobile);

        return apiService.registerStep2(builder.build());
    }
}
